import { createSlice, PayloadAction } from "@reduxjs/toolkit";



interface OptionType {
    adminInfo: any;
}


const initialState: OptionType = {
    adminInfo: localStorage.getItem("adminInfo") ? localStorage.getItem("adminInfo") : null,
}

const optionSlice = createSlice({
    name: "option",
    initialState,
    reducers: {
        changeInfo(state, action: PayloadAction<any>) {
            state.adminInfo = action.payload
        }
    }
})

export const { changeInfo } = optionSlice.actions
export default optionSlice.reducer